# !/usr/bin/env python
# encoding: utf-8


"""
  @author: gaogao
  @file: data_transfer_station.py
  @time: 2022/4/23 17:33
  @desc:
"""

DTS = None


def get_DTS():
    global DTS
    if DTS is None:
        DTS = DataTransferStation()
    return DTS


class DataTransferStation:
    def __init__(self):
        self.clear()

    def clear(self):
        self.data = {}

    def postarraydata(self, parameter_name, valuelist):
        """
        Post multi point data
        """
        if parameter_name not in self.data:
            self.data[parameter_name] = []
        self.data[parameter_name] = valuelist

    def post_signal_data(self, parameter_name, value):
        if parameter_name not in self.data:
            self.data[parameter_name] = None
        self.data[parameter_name] = value


    
